package com.ghost.view.tip
{
	import com.ghost.UI.Ghost_tip_base;
	import com.ghost.UI.Ghost_txt;
	import com.ghost.model.Object_pool;
	import com.ghost.model.UI_skin_data;
	
	import flash.display.Bitmap;
	import flash.display.DisplayObject;
	import flash.filters.GlowFilter;
	import flash.text.TextFieldAutoSize;
	/**
	 * 普通tip模板 
	 * @author ghost
	 */
	public class Tip2 extends Ghost_tip_base
	{
		private var txt:Ghost_txt;
		private var bg:DisplayObject;
		public function Tip2()
		{
			super();
			bg = new UI_skin_data.ghost_tip_skin_v[1]() as DisplayObject;
			this.addChild(bg);
			txt = new Ghost_txt();
			txt.scroll_bool = false;
			this.addChild(txt);
			txt.wordWrap = false;
			txt.autoSize = TextFieldAutoSize.LEFT;
			txt.filters = [new GlowFilter()];
		}
		override public function show(id:String,source_xml:String,color_n:int=0):void
		{
			//根据需求修改-------------------------
			var content_str:String = Object_pool.data_obj_pool.get(source_xml).list[id].des;
			txt.htmlText = content_str;
			set_bg_size();
		}
		private function set_bg_size():void
		{
			bg.width = txt.width;
			bg.height = txt.height;
			bg.alpha = 0.6;
		}
		override public function set_bg(bg_class_v:Vector.<Object>):void
		{
			this.removeChild(bg);
			bg = null;
			bg = new bg_class_v[1]() as Bitmap;
			this.addChildAt(bg,0);
			set_bg_size();
		}
	}
}